package com.ruoyi.manage.enterprise.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.ListUtil;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.manage.enterprise.domain.EcEnterpriseProgress;
import com.ruoyi.manage.enterprise.mapper.EcEnterpriseProgressMapper;
import com.ruoyi.manage.enterprise.service.IEcEnterpriseProgressService;
import org.springframework.stereotype.Service;

import java.util.Date;


/**
 * 企业认证流程Service业务层处理
 *
 * @author ruoyi
 * @date 2025-08-21
 */
@Service
public class EcEnterpriseProgressServiceImpl extends ServiceImpl<EcEnterpriseProgressMapper, EcEnterpriseProgress> implements IEcEnterpriseProgressService{


    @Override
    public EcEnterpriseProgress queryGetById(Long id){
        EcEnterpriseProgress ecEnterpriseProgress = this.getById(id);
        return ecEnterpriseProgress;
    }

    /**
     * 新增企业认证流程
     *
     * @param ecEnterpriseProgress 企业认证流程
     * @return 结果
     */
    @Override
    public boolean addEcEnterpriseProgress(EcEnterpriseProgress ecEnterpriseProgress){
        SysUser user = SecurityUtils.getLoginUser().getUser();
        ecEnterpriseProgress.setOperator(user.getNickName());
        ecEnterpriseProgress.setRecordTime(new Date());
        boolean save =this.save(ecEnterpriseProgress);
        return save;
    }

    /**
     * 修改企业认证流程
     *
     * @param ecEnterpriseProgress 企业认证流程
     * @return 结果
     */
    @Override
    public boolean updateEcEnterpriseProgress(EcEnterpriseProgress ecEnterpriseProgress){
        return this.updateById(ecEnterpriseProgress);
    }

    /**
     * 批量删除企业认证流程
     *
     * @param ids 需要删除的企业认证流程主键
     * @return 结果
     */
    @Override
    public boolean deleteEcEnterpriseProgressByIds(Long[] ids){
        return this.removeByIds(ListUtil.toList(ids));
    }

}
